﻿@{
    Layout = "~/Themes/CNet/Shared/_HomePage_Master.cshtml";
    var ManufacturerModel = ViewBag.ManufacturerModel;
    var ProductOverviewModel = ViewBag.ProductOverviewModel;
    string addtocartlink = Url.RouteUrl("AddProductToCart", new { productId = ProductOverviewModel.Id });
}
<script type="text/javascript">
    $(function () {
        //店铺推荐
        $("#myRecommend").click(function () {

            var shopId = $("#hdShopId").val();
            $.ajax({
                url: '/Shop/ShopRecommend',
                type: 'post',
                data: { shopId: shopId },
                dataType: 'json',
                success: function (data) {
                    //0→插入失败、1→推荐成功、2→已经推荐过了、3→未登录
                    if (data) {
                        if (data.msg == "0") {
                            alert("推荐失败，请稍后再试！");
                        } else if (data.msg == "1") {
                            alert("推荐成功");
                            //更新数字
                            $("#recommendCount").text(parseInt($("#recommendCount").text()) + 1);
                        } else if (data.msg == "2") {
                            alert("您已经推荐过了");
                        } else if (data.msg == "3") {
                            alert("请先登录再推荐");
                        }
                    }
                }
            });
        });
    });
</script>
<div class="shop_main">
 <input type="hidden" id="hdShopId" value="@ViewBag.shopId" />
    <div class="shop_attrs">
        <div class="info_all">
            <div class="metro_title_text">@ManufacturerModel.Name</div>
            <div class="clear">
            </div>
            <!--餐厅信息 -->
            <div class="metro_rectangle_narrow metro">
                <!-- 导航 -->
                <table style="margin-left: 12px; margin-top: 12px;">
                    <!-- comment_id:1343 img: -->
                    <tbody>
                        <tr>
                            <td class="info_site">@ManufacturerModel.Address
                            </td>
                        </tr>
                        <tr>
                            <td class="info_tel">@ManufacturerModel.Phone
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div class="metro_small_red metro" id="myRecommend" style="cursor: pointer;">
                <div style="left: 0px; bottom: -50px; margin: 5px; font-size: 24px; color: #fff;">
                    我推荐</div>
                <div class="recommend_button">
                </div>
            </div>
            <div class="metro_small metro">
                <div class="info_wantnum">
                    <span>
                        <img src="@Url.Content("~/themes/Cnet/Content/image/recommend_grey.png")"></span><span
                            class="info_txt" id="recommendCount">@ManufacturerModel.RecommendCount</span>推荐<span>
                                <img src="@Url.Content("~/themes/Cnet/Content/image/like_grey.png")"></span>
                </div>
                <div class="metro_text_normal">
                    总订单：@ManufacturerModel.OrderCount</div>
                <div class="metro_text_xx">
                    @for (int i = 0; i < ManufacturerModel.StarCount; i++)
                    {
                        <img src="@Url.Content("~/themes/Cnet/Content/image/metro_text_xx.jpg")" />
                    }
                </div>
            </div>
            <div class="shop_buy">
                <div class="shop_buy_left">
                    <img src="@ProductOverviewModel.DefaultPictureModel.FullSizeImageUrl" width="310" height="310"></div>
                <div class="shop_buy_right">
                    <ul>
                        <li><b class="font07">@ProductOverviewModel.Name</b></li>
                        <li>价格:&nbsp;&nbsp;<b class="font05">￥@ProductOverviewModel.ProductPrice.Price</b></li>
                        <li>购买量:&nbsp;&nbsp;<span class="font08">@Html.Raw(ProductOverviewModel.TradingVolume + "件")</span></li>
                        <li>点击量:&nbsp;&nbsp;<span class="font08">@Html.Raw(ProductOverviewModel.ClickNumber + "次")<span></li>
                        <li>评星:&nbsp;&nbsp;
                            <img src="@Url.Content("~/themes/Cnet/Content/image/metro_text_xx.jpg")">
                            <img src="@Url.Content("~/themes/Cnet/Content/image/metro_text_xx.jpg")">
                            <img src="@Url.Content("~/themes/Cnet/Content/image/metro_text_xx.jpg")">
                            <img src="@Url.Content("~/themes/Cnet/Content/image/metro_text_xx.jpg")">
                            <img src="@Url.Content("~/themes/Cnet/Content/image/metro_text_xx.jpg")">
                        </li>
                        <li><a href="#">
                            <img onclick="AjaxCart.byNow('@addtocartlink');return false;" src="@Url.Content("~/themes/Cnet/Content/image/buy_button.jpg")"></a>&nbsp;&nbsp;
                            <a href="#">
                                <img onclick="AjaxCart.addproducttocart('@addtocartlink');return false;" src="@Url.Content("~/themes/Cnet/Content/image/cart_button.jpg")"></a></li>
                    </ul>
                </div>
               @* <div class="shop_buy_bottom">
                    <img src="@Url.Content("~/themes/Cnet/Content/image/buy_bottom_title.jpg")"></div>*@
            </div>
               <div class="search_main">
    <div class="search_attrs">
            <div class="search_pr">
     <div class="search_xq_top"><b>猜你喜欢：</b></div>
     @Html.Action("UserInterests", "Catalog", new { foodId = ViewBag.productId })
    </div>
    </div>
    </div>
           
                    </div>
                </div>
            </div>
